﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LCA.Community.DAL.Model;

namespace LCA.Community.DAL.Test.ModelFactories
{
    public class GroupsFactory
    {
        private int _count = 0;

        public GroupsFactory()
        {

        }

        public Group CreateEntity(string groupOwner)
        {
            var group = new Group(
                                groupOwner,
                                String.Format("Group{0}",_count),
                                String.Format("Group {0}",_count),
                                String.Format("Description of the group {0}.",_count),
                                String.Format("http://www.group{0}.com",_count),
                                String.Format("City",_count),
                                String.Format("group{0}.jpg",_count)
                            );
            group.RowKey = String.Format("test.{0}", Guid.NewGuid());
            _count++;
            return group;
        }

        public List<Group> CreateList(int count, string groupOwner)
        {
            var groups = new List<Group>();

            for (int i = 0; i < count; i++)
            {
                groups.Add(CreateEntity(groupOwner));
            }

            return groups;
        }
    }
}
